 

package com.zdkj.subway.rca.controller;


import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zdkj.common.core.constant.CommonConstants;
import com.zdkj.common.core.util.R;
import com.zdkj.common.log.annotation.SysLog;
import com.zdkj.common.security.service.PigxUser;
import com.zdkj.common.security.util.SecurityUtils;
import com.zdkj.subway.rca.dto.in.UserDto;
import com.zdkj.subway.rca.entity.*;
import com.zdkj.subway.rca.service.*;
import com.zdkj.subway.rca.util.UserUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.Map;


/**
 * 银行电子账单与对账确认表汇总表
 *
 * @author stw
 * @date 2020-09-28 09:48:37
 */
@RestController
@AllArgsConstructor
@RequestMapping("/swckbankverifypayment" )
@Api(value = "swckbankverifypayment", tags = "银行票据单管理-银行电子账单与对账确认表-银行电子账单与对账确认表汇总表管理")
public class SwCkBankVerifyPaymentController {
    @Autowired
    private SwCkBankVerifyPaymentService swCkBankVerifyPaymentService;

    @Autowired
    private SwCkStatementConfirmFacetoBankService swCkStatementConfirmFacetoBankService;
    @Autowired
    private SwCkStatementConfirmFacetoBankTmpService swCkStatementConfirmFacetoBankTmpService;

    @Autowired
    private SwCkStatementConfirmFacetoWechatService swCkStatementConfirmFacetoWechatService;
    @Autowired
    private SwCkStatementConfirmFacetoWechatTmpService swCkStatementConfirmFacetoWechatTmpService;

    @Autowired
    private SwCkStatementConfirmFacetoAlipayService swCkStatementConfirmFacetoAlipayService;
    @Autowired
    private SwCkStatementConfirmFacetoAlipayTmpService swCkStatementConfirmFacetoAlipayTmpService;

    @Autowired
    private SwCkStatementConfirmBomQrAlipayService swCkStatementConfirmBomQrAlipayService;
    @Autowired
    private SwCkStatementConfirmBomQrAlipayTmpService swCkStatementConfirmBomQrAlipayTmpService;

    @Autowired
    private SwCkStatementConfirmBomQrWechatService swCkStatementConfirmBomQrWechatService;
    @Autowired
    private SwCkStatementConfirmBomQrWechatTmpService swCkStatementConfirmBomQrWechatTmpService;

    @Autowired
    private SwCkStatementConfirmTvmAlipayService swCkStatementConfirmTvmAlipayService;
    @Autowired
    private SwCkStatementConfirmTvmAlipayTmpService swCkStatementConfirmTvmAlipayTmpService;

    @Autowired
    private SwCkStatementConfirmTvmWechatService swCkStatementConfirmTvmWechatService;
    @Autowired
    private SwCkStatementConfirmTvmWechatTmpService swCkStatementConfirmTvmWechatTmpService;

    @Autowired
    private SwCkStatementConfirmTvmBankService swCkStatementConfirmTvmBankService;
    @Autowired
    private SwCkStatementConfirmTvmBankTmpService swCkStatementConfirmTvmBankTmpService;

    @Autowired
    private SwCkStatementConfirmBankQrConsumeService swCkStatementConfirmBankQrConsumeService;
    @Autowired
    private SwCkStatementConfirmBankQrConsumeTmpService swCkStatementConfirmBankQrConsumeTmpService;

    @Autowired
    private SwCkStatementConfirmBankQuickpassQrConsumeService swCkStatementConfirmBankQuickpassQrConsumeService;
    @Autowired
    private SwCkStatementConfirmBankQuickpassQrConsumeTmpService swCkStatementConfirmBankQuickpassQrConsumeTmpService;

    @Autowired
    private SwCkStatementConfirmAlipayQrConsumeService swCkStatementConfirmAlipayQrConsumeService;
    @Autowired
    private SwCkStatementConfirmAlipayQrConsumeTmpService swCkStatementConfirmAlipayQrConsumeTmpService;

    @Autowired
    private SwCkStatementConfirmWechatQrConsumeService swCkStatementConfirmWechatQrConsumeService;
    @Autowired
    private SwCkStatementConfirmWechatQrConsumeTmpService swCkStatementConfirmWechatQrConsumeTmpService;

    @Autowired
    private SwCkStatementConfirmAirQrConsumeService swCkStatementConfirmAirQrConsumeService;
    @Autowired
    private SwCkStatementConfirmAirQrConsumeTmpService swCkStatementConfirmAirQrConsumeTmpService;

    @Autowired
    private SwCkStatementCatReplenishService swCkStatementCatReplenishService;
    @Autowired
    private SwCkStatementCatReplenishTmpService swCkStatementCatReplenishTmpService;

    @Autowired
    private SwCkStatementCatSubwayconsumeService swCkStatementCatSubwayconsumeService;
    @Autowired
    private SwCkStatementCatSubwayconsumeTmpService swCkStatementCatSubwayconsumeTmpService;

    @Autowired
    private SwCkStatementJtyktSubwayconsumeService swCkStatementJtyktSubwayconsumeService;
    @Autowired
    private SwCkStatementJtyktSubwayconsumeTmpService swCkStatementJtyktSubwayconsumeTmpService;

    @Autowired
    private SwCkClearingConfirmChanganCardService swCkClearingConfirmChanganCardService;
    @Autowired
    private SwCkClearingConfirmChanganCardTmpService swCkClearingConfirmChanganCardTmpService;

    @Autowired
    private SwCkClearingConfirmTrafficCardService swCkClearingConfirmTrafficCardService;
    @Autowired
    private SwCkClearingConfirmTrafficCardTmpService swCkClearingConfirmTrafficCardTmpService;

	@Autowired
    private SwCkStatementCatXaztReplenishService swCkStatementCatXaztReplenishService;
    @Autowired
    private SwCkStatementCatXaztReplenishTmpService swCkStatementCatXaztReplenishTmpService;

    @Autowired
    private SwCkStatementConfirmAppQrConsumeService swCkStatementConfirmAppQrConsumeService;
    @Autowired
    private SwCkStatementConfirmAppQrConsumeTmpService swCkStatementConfirmAppQrConsumeTmpService;

	@Autowired
    private SwCkStatementConfirmAppWechatService swCkStatementConfirmAppWechatService;
    @Autowired
    private SwCkStatementConfirmAppWechatTmpService swCkStatementConfirmAppWechatTmpService;

    @Autowired
    private SwCkStatementConfirmDailyticketCatConsumeService swCkStatementConfirmDailyticketCatConsumeService;
    @Autowired
    private SwCkStatementConfirmDailyticketCatConsumeTmpService swCkStatementConfirmDailyticketCatConsumeTmpService;

	@Autowired
    private SwCkStatementConfirmAlipayQrConnectivityService swCkStatementConfirmAlipayQrConnectivityService;
    @Autowired
    private SwCkStatementConfirmAlipayQrConnectivityTmpService swCkStatementConfirmAlipayQrConnectivityTmpService;

	@Autowired
    private SwCkStatementConfirmWechatQrConnectivityService swCkStatementConfirmWechatQrConnectivityService;
    @Autowired
    private SwCkStatementConfirmWechatQrConnectivityTmpService swCkStatementConfirmWechatQrConnectivityTmpService;

	@Autowired
    private SwCkStatementConfirmBomPosService swCkStatementConfirmBomPosService;
    @Autowired
    private SwCkStatementConfirmBomPosTmpService swCkStatementConfirmBomPosTmpService;
    /**
     * 分页查询
     * @param page 分页对象
     * @return
     */
    @ApiOperation(value = "分页查询", notes = "分页查询")
    @GetMapping("/page" )
    public R getSwCkBankVerifyPaymentPage(Page page, String beginTime, String endTime, String verfiyConfirmFlag) {
        SwCkBankVerifyPayment swCkBankVerifyPayment = new SwCkBankVerifyPayment();
        if(StringUtils.isNotEmpty(beginTime) && StringUtils.isNotEmpty(endTime)){
            return R.ok(swCkBankVerifyPaymentService.page(page, Wrappers.query(swCkBankVerifyPayment).select("id,import_time,begin_time,end_time,import_creator_id,import_creator_code,improt_creator_name,verify_confirm_name,verfiy_confirm_flag,import_status,\n" +
                    "\tdept_id,creator_id,creator_name,MAX(create_time) as createTime,update_time,del_flag").lambda()
                    .or(Wrapper -> Wrapper.le(SwCkBankVerifyPayment::getBeginTime,beginTime)
                            .between(SwCkBankVerifyPayment::getEndTime,beginTime,endTime)
                            .eq(SwCkBankVerifyPayment::getImportStatus,"1")
                            .eq(StringUtils.isNotEmpty(verfiyConfirmFlag),SwCkBankVerifyPayment::getVerfiyConfirmFlag, verfiyConfirmFlag)
                            .eq(SwCkBankVerifyPayment::getDelFlag,"0"))
                    .or(Wrapper -> Wrapper.le(SwCkBankVerifyPayment::getEndTime,endTime)
                            .between(SwCkBankVerifyPayment::getBeginTime,beginTime,endTime)
                            .eq(SwCkBankVerifyPayment::getImportStatus,"1")
                            .eq(StringUtils.isNotEmpty(verfiyConfirmFlag),SwCkBankVerifyPayment::getVerfiyConfirmFlag, verfiyConfirmFlag)
                            .eq(SwCkBankVerifyPayment::getDelFlag,"0"))
                    .or(Wrapper -> Wrapper.gt(SwCkBankVerifyPayment::getEndTime,endTime)
                            .between(SwCkBankVerifyPayment::getBeginTime,beginTime,endTime)
                            .eq(SwCkBankVerifyPayment::getImportStatus,"1")
                            .eq(StringUtils.isNotEmpty(verfiyConfirmFlag),SwCkBankVerifyPayment::getVerfiyConfirmFlag, verfiyConfirmFlag)
                            .eq(SwCkBankVerifyPayment::getDelFlag,"0"))
                    .groupBy(SwCkBankVerifyPayment::getBeginTime,SwCkBankVerifyPayment::getEndTime,SwCkBankVerifyPayment::getVerfiyConfirmFlag)
                    .orderByDesc(SwCkBankVerifyPayment::getImportTime)));
        }else {
            return R.ok(swCkBankVerifyPaymentService.page(page, Wrappers.query(swCkBankVerifyPayment).lambda()
                    .eq(SwCkBankVerifyPayment::getImportStatus,"1")
                    .eq(StringUtils.isNotEmpty(beginTime), SwCkBankVerifyPayment::getBeginTime, beginTime)
                    .eq(StringUtils.isNotEmpty(endTime), SwCkBankVerifyPayment::getEndTime, endTime)
                    .eq(StringUtils.isNotEmpty(verfiyConfirmFlag),SwCkBankVerifyPayment::getVerfiyConfirmFlag, verfiyConfirmFlag)
                    .eq(SwCkBankVerifyPayment::getDelFlag,"0")
                    .groupBy(SwCkBankVerifyPayment::getBeginTime,SwCkBankVerifyPayment::getEndTime,SwCkBankVerifyPayment::getVerfiyConfirmFlag)
                    .orderByDesc(SwCkBankVerifyPayment::getImportTime)));
        }
    }

    /**
     * 导入前确认表列表查询
     * @return
     */
    @ApiOperation(value = "导入前确认表列表查询", notes = "导入前确认表列表查询")
    @GetMapping("/listConfirmTablePre" )
    @PreAuthorize("@pms.hasPermission('sw_ck_bank_verify_payment_import')")
    public R getSwCkBankVerifyPaymentConfirmTableListPre() {
        List<Map<String,String>> list = swCkBankVerifyPaymentService.getSwCkBankVerifyPaymentConfirmTableListPre();
        return R.ok(list);
    }

    /**
     * 导出模板
     * @param
     * @return
     * @throws IOException
     */
    @ApiOperation(value = "导出模板", notes = "导出模板")
    @GetMapping({"/exportTamplates"})
    @PreAuthorize("@pms.hasPermission('sw_ck_bank_verify_payment_import')")
    public void exportTamplates(String verfiyConfirmFlag, HttpServletResponse response) {
        swCkBankVerifyPaymentService.exportTamplates(verfiyConfirmFlag,response);
    }

    /**
     * 批量导入对账确认表
     * @param file
     * @param verfiyConfirmFlag
     * @return
     * @throws Exception
     */
    @ApiOperation(value = "批量导入对账确认表", notes = "批量导入对账确认表")
    @SysLog("批量导入对账确认表")
    @PostMapping(value = "/saveBatch",  headers = "content-type=multipart/form-data")
    @PreAuthorize("@pms.hasPermission('sw_ck_bank_verify_payment_import')")
    public R saveBatch(@RequestParam(value = "file") MultipartFile file, @RequestParam String verfiyConfirmFlag) throws Exception {
        return R.ok((Object)this.swCkBankVerifyPaymentService.saveBatchWithExcel(file,verfiyConfirmFlag));
    }

    /**
     * 导入后确认表列表查询
     * @return
     */
    @ApiOperation(value = "导入后确认表列表查询", notes = "导入后确认表列表查询")
    @GetMapping("/listConfirmTable" )
    @PreAuthorize("@pms.hasPermission('sw_ck_bank_verify_payment_import')")
    public R getSwCkBankVerifyPaymentConfirmTableList() {
        List<Map<String,String>> list = swCkBankVerifyPaymentService.getSwCkBankVerifyPaymentConfirmTableList();
        return R.ok(list);
    }


    /**
     * 各个确认表导入预处理查询
     * @return
     */
    @ApiOperation(value = "各个确认表导入预处理查询", notes = "各个确认表导入预处理查询")
    @GetMapping("/listPreprocessing" )
    @PreAuthorize("@pms.hasPermission('sw_ck_bank_verify_payment_import')")
    public R listPreprocessing(String verfiyConfirmFlag) {
        PigxUser user = SecurityUtils.getUser();
        if("1".equals(verfiyConfirmFlag)) { //人脸识别银联确认表（建行的）
            SwCkStatementConfirmFacetoBankTmp swCkStatementConfirmFacetoBankTmp = new  SwCkStatementConfirmFacetoBankTmp();
            swCkStatementConfirmFacetoBankTmp.setCreatorId(user.getId());
            return R.ok(swCkStatementConfirmFacetoBankTmpService.list(Wrappers.query(swCkStatementConfirmFacetoBankTmp)));
        } else if("2".equals(verfiyConfirmFlag)) { //人脸识别微信确认表
            SwCkStatementConfirmFacetoWechatTmp swCkStatementConfirmFacetoWechatTmp = new  SwCkStatementConfirmFacetoWechatTmp();
            swCkStatementConfirmFacetoWechatTmp.setCreatorId(user.getId());
            return R.ok(swCkStatementConfirmFacetoWechatTmpService.list(Wrappers.query(swCkStatementConfirmFacetoWechatTmp)));
        } else if("3".equals(verfiyConfirmFlag)) {//人脸识别支付宝确认表
            SwCkStatementConfirmFacetoAlipayTmp swCkStatementConfirmFacetoAlipayTmp = new  SwCkStatementConfirmFacetoAlipayTmp();
            swCkStatementConfirmFacetoAlipayTmp.setCreatorId(user.getId());
            return R.ok(swCkStatementConfirmFacetoAlipayTmpService.list(Wrappers.query(swCkStatementConfirmFacetoAlipayTmp)));
        }  else if("4".equals(verfiyConfirmFlag)) {//"西安地铁支付宝二维码BOM确认表
            SwCkStatementConfirmBomQrAlipayTmp swCkStatementConfirmBomQrAlipayTmp = new  SwCkStatementConfirmBomQrAlipayTmp();
            swCkStatementConfirmBomQrAlipayTmp.setCreatorId(user.getId());
            return R.ok(swCkStatementConfirmBomQrAlipayTmpService.list(Wrappers.query(swCkStatementConfirmBomQrAlipayTmp)));
        }  else if("5".equals(verfiyConfirmFlag)) {//西安地铁微信二维码BOM确认表
            SwCkStatementConfirmBomQrWechatTmp swCkStatementConfirmBomQrWechatTmp = new  SwCkStatementConfirmBomQrWechatTmp();
            swCkStatementConfirmBomQrWechatTmp.setCreatorId(user.getId());
            return R.ok(swCkStatementConfirmBomQrWechatTmpService.list(Wrappers.query(swCkStatementConfirmBomQrWechatTmp)));
        }  else if("6".equals(verfiyConfirmFlag)) {//西安地铁支付宝TVM确认表
            SwCkStatementConfirmTvmAlipayTmp swCkStatementConfirmTvmAlipayTmp = new  SwCkStatementConfirmTvmAlipayTmp();
            swCkStatementConfirmTvmAlipayTmp.setCreatorId(user.getId());
            return R.ok(swCkStatementConfirmTvmAlipayTmpService.list(Wrappers.query(swCkStatementConfirmTvmAlipayTmp)));
        }  else if("7".equals(verfiyConfirmFlag)) {//西安地铁微信TMV确认表
            SwCkStatementConfirmTvmWechatTmp swCkStatementConfirmTvmWechatTmp = new  SwCkStatementConfirmTvmWechatTmp();
            swCkStatementConfirmTvmWechatTmp.setCreatorId(user.getId());
            return R.ok(swCkStatementConfirmTvmWechatTmpService.list(Wrappers.query(swCkStatementConfirmTvmWechatTmp)));
        } else if("8".equals(verfiyConfirmFlag)) {//西安地铁建行TVM确认表
            SwCkStatementConfirmTvmBankTmp swCkStatementConfirmTvmBankTmp = new  SwCkStatementConfirmTvmBankTmp();
            swCkStatementConfirmTvmBankTmp.setCreatorId(user.getId());
            return R.ok(swCkStatementConfirmTvmBankTmpService.list(Wrappers.query(swCkStatementConfirmTvmBankTmp)));
        }  else if("9".equals(verfiyConfirmFlag)) {//西安地铁银联（自发码）二维码消费过闸确认表
            SwCkStatementConfirmBankQrConsumeTmp swCkStatementConfirmBankQrConsumeTmp = new  SwCkStatementConfirmBankQrConsumeTmp();
            swCkStatementConfirmBankQrConsumeTmp.setCreatorId(user.getId());
            return R.ok(swCkStatementConfirmBankQrConsumeTmpService.list(Wrappers.query(swCkStatementConfirmBankQrConsumeTmp)));
        }  else if("10".equals(verfiyConfirmFlag)) {//西安地铁银联（自发码）二维码消费过闸确认表
            SwCkStatementConfirmBankQuickpassQrConsumeTmp swCkStatementConfirmBankQuickpassQrConsumeTmp = new  SwCkStatementConfirmBankQuickpassQrConsumeTmp();
            swCkStatementConfirmBankQuickpassQrConsumeTmp.setCreatorId(user.getId());
            return R.ok(swCkStatementConfirmBankQuickpassQrConsumeTmpService.list(Wrappers.query(swCkStatementConfirmBankQuickpassQrConsumeTmp)));
        }  else if("11".equals(verfiyConfirmFlag)) {//西安地铁支付宝二维码消费过闸确认表
            SwCkStatementConfirmAlipayQrConsumeTmp swCkStatementConfirmAlipayQrConsumeTmp = new  SwCkStatementConfirmAlipayQrConsumeTmp();
            swCkStatementConfirmAlipayQrConsumeTmp.setCreatorId(user.getId());
            return R.ok(swCkStatementConfirmAlipayQrConsumeTmpService.list(Wrappers.query(swCkStatementConfirmAlipayQrConsumeTmp)));
        } else if("12".equals(verfiyConfirmFlag)) {//西安地铁银联（自发码）二维码消费过闸确认表
            SwCkStatementConfirmWechatQrConsumeTmp swCkStatementConfirmWechatQrConsumeTmp = new  SwCkStatementConfirmWechatQrConsumeTmp();
            swCkStatementConfirmWechatQrConsumeTmp.setCreatorId(user.getId());
            return R.ok(swCkStatementConfirmWechatQrConsumeTmpService.list(Wrappers.query(swCkStatementConfirmWechatQrConsumeTmp)));
        /*}   else if("13".equals(verfiyConfirmFlag)) {//西安地铁城际二维码消费过闸确认表--此导入已经取消
            SwCkStatementConfirmAirQrConsumeTmp swCkStatementConfirmAirQrConsumeTmp = new SwCkStatementConfirmAirQrConsumeTmp();
            swCkStatementConfirmAirQrConsumeTmp.setCreatorId(user.getId());
            return R.ok(swCkStatementConfirmAirQrConsumeTmpService.list(Wrappers.query(swCkStatementConfirmAirQrConsumeTmp)));*/
        }   else if("13".equals(verfiyConfirmFlag)) {//长安通卡充资对账确认表（中铁-地铁）
            SwCkStatementCatXaztReplenishTmp swCkStatementCatXaztReplenishTmp = new  SwCkStatementCatXaztReplenishTmp();
            swCkStatementCatXaztReplenishTmp.setCreatorId(user.getId());
            return R.ok(swCkStatementCatXaztReplenishTmpService.list(Wrappers.query(swCkStatementCatXaztReplenishTmp)));
        } else if("14".equals(verfiyConfirmFlag)) {//长安通卡充资对账确认表（长安通-地铁）
            SwCkStatementCatReplenishTmp swCkStatementCatReplenishTmp = new  SwCkStatementCatReplenishTmp();
            swCkStatementCatReplenishTmp.setCreatorId(user.getId());
            return R.ok(swCkStatementCatReplenishTmpService.list(Wrappers.query(swCkStatementCatReplenishTmp)));
        } else if("15".equals(verfiyConfirmFlag)) {//长安通地铁消费对账确认表
            SwCkStatementCatSubwayconsumeTmp swCkStatementCatSubwayconsumeTmp = new  SwCkStatementCatSubwayconsumeTmp();
            swCkStatementCatSubwayconsumeTmp.setCreatorId(user.getId());
            return R.ok(swCkStatementCatSubwayconsumeTmpService.list(Wrappers.query(swCkStatementCatSubwayconsumeTmp)));
        }  else if("16".equals(verfiyConfirmFlag)) {//交通一卡通地铁消费对账确认表
            SwCkStatementJtyktSubwayconsumeTmp swCkStatementJtyktSubwayconsumeTmp = new  SwCkStatementJtyktSubwayconsumeTmp();
            swCkStatementJtyktSubwayconsumeTmp.setCreatorId(user.getId());
            return R.ok(swCkStatementJtyktSubwayconsumeTmpService.list(Wrappers.query(swCkStatementJtyktSubwayconsumeTmp)));
        } else if("17".equals(verfiyConfirmFlag)) {//清分确认长安通卡
            SwCkClearingConfirmChanganCardTmp swCkClearingConfirmChanganCardTmp = new  SwCkClearingConfirmChanganCardTmp();
            swCkClearingConfirmChanganCardTmp.setCreatorId(user.getId());
            return R.ok(swCkClearingConfirmChanganCardTmpService.list(Wrappers.query(swCkClearingConfirmChanganCardTmp)));
        } else if("18".equals(verfiyConfirmFlag)) {//清分确认交通卡
            SwCkClearingConfirmTrafficCardTmp swCkClearingConfirmTrafficCardTmp = new SwCkClearingConfirmTrafficCardTmp();
            swCkClearingConfirmTrafficCardTmp.setCreatorId(user.getId());
            return R.ok(swCkClearingConfirmTrafficCardTmpService.list(Wrappers.query(swCkClearingConfirmTrafficCardTmp)));
        } else if("19".equals(verfiyConfirmFlag)) {//西安地铁招行APP代售表
            SwCkStatementConfirmAppQrConsumeTmp swCkStatementConfirmAppQrConsumeTmp = new  SwCkStatementConfirmAppQrConsumeTmp();
            swCkStatementConfirmAppQrConsumeTmp.setCreatorId(user.getId());
            return R.ok(swCkStatementConfirmAppQrConsumeTmpService.list(Wrappers.query(swCkStatementConfirmAppQrConsumeTmp)));
		} else if("20".equals(verfiyConfirmFlag)) {//长安通日票代售确认表
            SwCkStatementConfirmDailyticketCatConsumeTmp swCkStatementConfirmDailyticketCatConsumeTmp = new  SwCkStatementConfirmDailyticketCatConsumeTmp();
            swCkStatementConfirmDailyticketCatConsumeTmp.setCreatorId(user.getId());
            return R.ok(swCkStatementConfirmDailyticketCatConsumeTmpService.list(Wrappers.query(swCkStatementConfirmDailyticketCatConsumeTmp)));
        }  else if("21".equals(verfiyConfirmFlag)) {//西安地铁支付宝应急及互联互通对账确认表
             SwCkStatementConfirmAlipayQrConnectivityTmp swCkStatementConfirmAlipayQrConnectivityTmp = new  SwCkStatementConfirmAlipayQrConnectivityTmp();
             swCkStatementConfirmAlipayQrConnectivityTmp.setCreatorId(user.getId());
            return R.ok(swCkStatementConfirmAlipayQrConnectivityTmpService.list(Wrappers.query(swCkStatementConfirmAlipayQrConnectivityTmp)));
        }  else if("22".equals(verfiyConfirmFlag)) {//西安地铁微信应急及互联互通对账确认表
            SwCkStatementConfirmWechatQrConnectivityTmp swCkStatementConfirmWechatQrConnectivityTmp = new  SwCkStatementConfirmWechatQrConnectivityTmp();
            swCkStatementConfirmWechatQrConnectivityTmp.setCreatorId(user.getId());
            return R.ok(swCkStatementConfirmWechatQrConnectivityTmpService.list(Wrappers.query(swCkStatementConfirmWechatQrConnectivityTmp)));
        } else if("23".equals(verfiyConfirmFlag)) {//西安地微信小程序对账确认表
            SwCkStatementConfirmAppWechatTmp swCkStatementConfirmAppWechatTmp = new  SwCkStatementConfirmAppWechatTmp();
            swCkStatementConfirmAppWechatTmp.setCreatorId(user.getId());
            return R.ok(swCkStatementConfirmAppWechatTmpService.list(Wrappers.query(swCkStatementConfirmAppWechatTmp)));
        } else if("24".equals(verfiyConfirmFlag)) {//西安地铁BOM电子支付POS机对账确认表
            SwCkStatementConfirmBomPosTmp swCkStatementConfirmBomPosTmp = new  SwCkStatementConfirmBomPosTmp();
            swCkStatementConfirmBomPosTmp.setCreatorId(user.getId());
            return R.ok(swCkStatementConfirmBomPosTmpService.list(Wrappers.query(swCkStatementConfirmBomPosTmp)));
        } else {
            return R.ok();
        }

    }
    
    /**
     * 各个确认表导入预处理确认
     * @param verfiyConfirmFlag
     * @return
     * @throws Exception
     */
    @ApiOperation(value = "各个确认表导入预处理确认", notes = "各个确认表导入预处理确认")
    //@SysLog("确认表导入预处理确认")
    @GetMapping({ "/saveBatchOk" })
    //@PreAuthorize("@pms.hasPermission('sw_ck_bank_verify_payment_import')")
    public R saveBatchOk(@RequestParam String verfiyConfirmFlag) throws Exception {
        PigxUser pigxUser = SecurityUtils.getUser();
        UserDto user = new UserDto();
        if(pigxUser == null){
            user = UserUtil.userDto();
        }else {
            user = UserUtil.pigxUser();
        }
        if("1".equals(verfiyConfirmFlag)) {
            this.swCkStatementConfirmFacetoBankTmpService.saveBatchWithExcelOk(user.getId());

        } else if("2".equals(verfiyConfirmFlag)) {
            this.swCkStatementConfirmFacetoWechatTmpService.saveBatchWithExcelOk(user.getId());

        }  else if("3".equals(verfiyConfirmFlag)) {
            this.swCkStatementConfirmFacetoAlipayTmpService.saveBatchWithExcelOk(user.getId());

        }  else if("4".equals(verfiyConfirmFlag)) {
            this.swCkStatementConfirmBomQrAlipayTmpService.saveBatchWithExcelOk(user.getId());

        }  else if("5".equals(verfiyConfirmFlag)) {
            this.swCkStatementConfirmBomQrWechatTmpService.saveBatchWithExcelOk(user.getId());

        }  else if("6".equals(verfiyConfirmFlag)) {
            this.swCkStatementConfirmTvmAlipayTmpService.saveBatchWithExcelOk(user.getId());

        }  else if("7".equals(verfiyConfirmFlag)) {
            this.swCkStatementConfirmTvmWechatTmpService.saveBatchWithExcelOk(user.getId());

        } else if("8".equals(verfiyConfirmFlag)) {
            this.swCkStatementConfirmTvmBankTmpService.saveBatchWithExcelOk(user.getId());

        }  else if("9".equals(verfiyConfirmFlag)) {
            this.swCkStatementConfirmBankQrConsumeTmpService.saveBatchWithExcelOk(user.getId());

        } else if("10".equals(verfiyConfirmFlag)) {
            this.swCkStatementConfirmBankQuickpassQrConsumeTmpService.saveBatchWithExcelOk(user.getId());

        } else if("11".equals(verfiyConfirmFlag)) {
            this.swCkStatementConfirmAlipayQrConsumeTmpService.saveBatchWithExcelOk(user.getId());

        } else if("12".equals(verfiyConfirmFlag)) {
            this.swCkStatementConfirmWechatQrConsumeTmpService.saveBatchWithExcelOk(user.getId());

        }   else if("13".equals(verfiyConfirmFlag)) {
            //this.swCkStatementConfirmAirQrConsumeTmpService.saveBatchWithExcelOk(user.getId());
			 this.swCkStatementCatXaztReplenishTmpService.saveBatchWithExcelOk(user.getId());

        }  else if("14".equals(verfiyConfirmFlag)) {
            this.swCkStatementCatReplenishTmpService.saveBatchWithExcelOk(user.getId());

        }  else if("15".equals(verfiyConfirmFlag)) {
            this.swCkStatementCatSubwayconsumeTmpService.saveBatchWithExcelOk(user.getId());

        }  else if("16".equals(verfiyConfirmFlag)) {
            this.swCkStatementJtyktSubwayconsumeTmpService.saveBatchWithExcelOk(user.getId());

        } else if("17".equals(verfiyConfirmFlag)) {
            this.swCkClearingConfirmChanganCardTmpService.saveBatchWithExcelOk(user.getId());

        } else if("18".equals(verfiyConfirmFlag)) {
            this.swCkClearingConfirmTrafficCardTmpService.saveBatchWithExcelOk(user.getId());

        }  else if("19".equals(verfiyConfirmFlag)) {
            this.swCkStatementConfirmAppQrConsumeTmpService.saveBatchWithExcelOk(user.getId());

        }  else if("20".equals(verfiyConfirmFlag)) {
            this.swCkStatementConfirmDailyticketCatConsumeTmpService.saveBatchWithExcelOk(user.getId());

        } else if("21".equals(verfiyConfirmFlag)) {//西安地铁支付宝应急及互联互通对账确认表
		    this.swCkStatementConfirmAlipayQrConnectivityTmpService.saveBatchWithExcelOk(user.getId());
            
        } else if("22".equals(verfiyConfirmFlag)) {//西安地铁微信应急及互联互通对账确认表
            this.swCkStatementConfirmWechatQrConnectivityTmpService.saveBatchWithExcelOk(user.getId());

        } else if("23".equals(verfiyConfirmFlag)) {//西安地微信小程序对账确认表
            this.swCkStatementConfirmAppWechatTmpService.saveBatchWithExcelOk(user.getId());

        } else if("24".equals(verfiyConfirmFlag)) {//西安地铁BOM电子支付POS机对账确认表
            this.swCkStatementConfirmBomPosTmpService.saveBatchWithExcelOk(user.getId());

        } else {
            return R.ok(false);
        }

        SwCkBankVerifyPayment swCkBankVerifyPayment = new SwCkBankVerifyPayment();
        swCkBankVerifyPaymentService.update(Wrappers.lambdaUpdate(swCkBankVerifyPayment).set(SwCkBankVerifyPayment::getImportStatus,"1").eq(SwCkBankVerifyPayment::getImportCreatorId,user.getId()).eq(SwCkBankVerifyPayment::getImportStatus,"0").eq(SwCkBankVerifyPayment::getVerfiyConfirmFlag,verfiyConfirmFlag));
        return R.ok(true);
    }
    /**
     * 各个确认表导入预处理取消
     * @param verfiyConfirmFlag
     * @return
     * @throws Exception
     */
    @ApiOperation(value = "各个确认表导入预处理取消", notes = "各个确认表导入预处理取消")
    @SysLog("确认表导入预处理取消")
    @GetMapping({ "/saveBatchCancel" })
    @PreAuthorize("@pms.hasPermission('sw_ck_bank_verify_payment_import')")
    public R saveBatchCancel(@RequestParam String verfiyConfirmFlag) throws Exception {
        PigxUser user = SecurityUtils.getUser();
        if("1".equals(verfiyConfirmFlag)) {
            this.swCkStatementConfirmFacetoBankTmpService.saveBatchWithExcelCancel(user.getId());

        } else if("2".equals(verfiyConfirmFlag)) {
            this.swCkStatementConfirmFacetoWechatTmpService.saveBatchWithExcelCancel(user.getId());

        }  else if("3".equals(verfiyConfirmFlag)) {
            this.swCkStatementConfirmFacetoAlipayTmpService.saveBatchWithExcelCancel(user.getId());

        }  else if("4".equals(verfiyConfirmFlag)) {
            this.swCkStatementConfirmBomQrAlipayTmpService.saveBatchWithExcelCancel(user.getId());

        }  else if("5".equals(verfiyConfirmFlag)) {
            this.swCkStatementConfirmBomQrWechatTmpService.saveBatchWithExcelCancel(user.getId());

        } else if("6".equals(verfiyConfirmFlag)) {
            this.swCkStatementConfirmTvmAlipayTmpService.saveBatchWithExcelCancel(user.getId());

        } else if("7".equals(verfiyConfirmFlag)) {
            this.swCkStatementConfirmTvmWechatTmpService.saveBatchWithExcelCancel(user.getId());

        } else if("8".equals(verfiyConfirmFlag)) {
            this.swCkStatementConfirmTvmBankTmpService.saveBatchWithExcelCancel(user.getId());

        } else if("9".equals(verfiyConfirmFlag)) {
            this.swCkStatementConfirmBankQrConsumeTmpService.saveBatchWithExcelCancel(user.getId());

        } else if("10".equals(verfiyConfirmFlag)) {
            this.swCkStatementConfirmBankQuickpassQrConsumeTmpService.saveBatchWithExcelCancel(user.getId());

        } else if("11".equals(verfiyConfirmFlag)) {
            this.swCkStatementConfirmAlipayQrConsumeTmpService.saveBatchWithExcelCancel(user.getId());

        } else if("12".equals(verfiyConfirmFlag)) {
            this.swCkStatementConfirmWechatQrConsumeTmpService.saveBatchWithExcelCancel(user.getId());

        } else if("13".equals(verfiyConfirmFlag)) {
            //this.swCkStatementConfirmAirQrConsumeTmpService.saveBatchWithExcelCancel(user.getId());
			this.swCkStatementCatXaztReplenishTmpService.saveBatchWithExcelCancel(user.getId());

        } else if("14".equals(verfiyConfirmFlag)) {
            this.swCkStatementCatReplenishTmpService.saveBatchWithExcelCancel(user.getId());

        } else if("15".equals(verfiyConfirmFlag)) {
            this.swCkStatementCatSubwayconsumeTmpService.saveBatchWithExcelCancel(user.getId());

        } else if("16".equals(verfiyConfirmFlag)) {
            this.swCkStatementJtyktSubwayconsumeTmpService.saveBatchWithExcelCancel(user.getId());

        }  else if("17".equals(verfiyConfirmFlag)) {
            this.swCkClearingConfirmChanganCardTmpService.saveBatchWithExcelCancel(user.getId());

        } else if("18".equals(verfiyConfirmFlag)) {
            this.swCkClearingConfirmTrafficCardTmpService.saveBatchWithExcelCancel(user.getId());

        } else if("19".equals(verfiyConfirmFlag)) {
            this.swCkStatementConfirmAppQrConsumeTmpService.saveBatchWithExcelCancel(user.getId());

        } else if("20".equals(verfiyConfirmFlag)) {
            this.swCkStatementConfirmDailyticketCatConsumeTmpService.saveBatchWithExcelCancel(user.getId());

        } else if("21".equals(verfiyConfirmFlag)) {//西安地铁支付宝应急及互联互通对账确认表
		    this.swCkStatementConfirmAlipayQrConnectivityTmpService.saveBatchWithExcelCancel(user.getId());
            
        } else if("22".equals(verfiyConfirmFlag)) {//西安地铁微信应急及互联互通对账确认表
            this.swCkStatementConfirmWechatQrConnectivityTmpService.saveBatchWithExcelCancel(user.getId());
        
		}else if("23".equals(verfiyConfirmFlag)) {//西安地微信小程序对账确认表
            this.swCkStatementConfirmAppWechatTmpService.saveBatchWithExcelCancel(user.getId());

        }else if("24".equals(verfiyConfirmFlag)) {//西安地铁BOM电子支付POS机对账确认表
            this.swCkStatementConfirmBomPosTmpService.saveBatchWithExcelCancel(user.getId());

        } else {
            return R.ok(false);
        }
        SwCkBankVerifyPayment swCkBankVerifyPayment = new SwCkBankVerifyPayment();
        swCkBankVerifyPaymentService.update(Wrappers.lambdaUpdate(swCkBankVerifyPayment).set(SwCkBankVerifyPayment::getImportStatus,"2").eq(SwCkBankVerifyPayment::getImportCreatorId,user.getId()).eq(SwCkBankVerifyPayment::getImportStatus,"0").eq(SwCkBankVerifyPayment::getVerfiyConfirmFlag,verfiyConfirmFlag));
        return R.ok(true);
    }

    /**
     * 各个确认表预览
     * @return
     */
    @ApiOperation(value = "各个确认表预览", notes = "各个确认表预览")
    @GetMapping("/listPreview" )
    @PreAuthorize("@pms.hasPermission('sw_ck_bank_verify_payment_import')")
    public R listPreview(String beginTime,String endTime,String importTime,String importCreatorId,String verfiyConfirmFlag) throws Exception {
        if(StringUtils.isEmpty(importTime) || StringUtils.isEmpty(verfiyConfirmFlag)){
            return R.ok(CommonConstants.FAIL);
        }
        Integer creatorId = null;
        if(StringUtils.isNotEmpty(importCreatorId)){
            creatorId = Integer.parseInt(importCreatorId);
        }
        String startDate = beginTime;//importTime + " 00:00:00";
        String endDate = endTime;// + " 23:59:59";
        if("1".equals(verfiyConfirmFlag)) {
            SwCkStatementConfirmFacetoBank swCkStatementConfirmFacetoBank = new SwCkStatementConfirmFacetoBank();
            //swCkStatementConfirmFacetoBank.setCreatorId(creatorId);
            return R.ok(swCkStatementConfirmFacetoBankService.list(Wrappers.query(swCkStatementConfirmFacetoBank).lambda().between(SwCkStatementConfirmFacetoBank::getTradeDate,startDate,endDate)));
        } else if("2".equals(verfiyConfirmFlag)) {
            SwCkStatementConfirmFacetoWechat swCkStatementConfirmFacetoWechat = new SwCkStatementConfirmFacetoWechat();
            //swCkStatementConfirmFacetoWechat.setCreatorId(creatorId);
            return R.ok(swCkStatementConfirmFacetoWechatService.list(Wrappers.query(swCkStatementConfirmFacetoWechat).lambda().between(SwCkStatementConfirmFacetoWechat::getTradeDate,startDate,endDate)));
        } else if("3".equals(verfiyConfirmFlag)) {
            SwCkStatementConfirmFacetoAlipay swCkStatementConfirmFacetoAlipay = new SwCkStatementConfirmFacetoAlipay();
            //swCkStatementConfirmFacetoAlipay.setCreatorId(creatorId);
            return R.ok(swCkStatementConfirmFacetoAlipayService.list(Wrappers.query(swCkStatementConfirmFacetoAlipay).lambda().between(SwCkStatementConfirmFacetoAlipay::getTradeDate,startDate,endDate)));
        } else if("4".equals(verfiyConfirmFlag)) {
            SwCkStatementConfirmBomQrAlipay swCkStatementConfirmBomQrAlipay = new SwCkStatementConfirmBomQrAlipay();
            //swCkStatementConfirmBomQrAlipay.setCreatorId(creatorId);
            return R.ok(swCkStatementConfirmBomQrAlipayService.list(Wrappers.query(swCkStatementConfirmBomQrAlipay).lambda().between(SwCkStatementConfirmBomQrAlipay::getTradeDate,startDate,endDate)));
        } else if("5".equals(verfiyConfirmFlag)) {
            SwCkStatementConfirmBomQrWechat swCkStatementConfirmBomQrWechat = new SwCkStatementConfirmBomQrWechat();
            //swCkStatementConfirmBomQrWechat.setCreatorId(creatorId);
            return R.ok(swCkStatementConfirmBomQrWechatService.list(Wrappers.query(swCkStatementConfirmBomQrWechat).lambda().between(SwCkStatementConfirmBomQrWechat::getTradeDate,startDate,endDate)));
        } else if("6".equals(verfiyConfirmFlag)) {
            SwCkStatementConfirmTvmAlipay swCkStatementConfirmTvmAlipay = new SwCkStatementConfirmTvmAlipay();
            //swCkStatementConfirmTvmAlipay.setCreatorId(creatorId);
            return R.ok(swCkStatementConfirmTvmAlipayService.list(Wrappers.query(swCkStatementConfirmTvmAlipay).lambda().between(SwCkStatementConfirmTvmAlipay::getTradeDate,startDate,endDate)));
        } else if("7".equals(verfiyConfirmFlag)) {
            SwCkStatementConfirmTvmWechat swCkStatementConfirmTvmWechat = new SwCkStatementConfirmTvmWechat();
            //swCkStatementConfirmTvmWechat.setCreatorId(creatorId);
            return R.ok(swCkStatementConfirmTvmWechatService.list(Wrappers.query(swCkStatementConfirmTvmWechat).lambda().between(SwCkStatementConfirmTvmWechat::getTradeDate,startDate,endDate)));
        } else if("8".equals(verfiyConfirmFlag)) {
            SwCkStatementConfirmTvmBank swCkStatementConfirmTvmBank = new SwCkStatementConfirmTvmBank();
            //swCkStatementConfirmTvmBank.setCreatorId(creatorId);
            return R.ok(swCkStatementConfirmTvmBankService.list(Wrappers.query(swCkStatementConfirmTvmBank).lambda().between(SwCkStatementConfirmTvmBank::getTradeDate,startDate,endDate)));
        } else if("9".equals(verfiyConfirmFlag)) {
            SwCkStatementConfirmBankQrConsume swCkStatementConfirmBankQrConsume = new SwCkStatementConfirmBankQrConsume();
            //swCkStatementConfirmBankQrConsume.setCreatorId(creatorId);
            return R.ok(swCkStatementConfirmBankQrConsumeService.list(Wrappers.query(swCkStatementConfirmBankQrConsume).lambda().between(SwCkStatementConfirmBankQrConsume::getTradeDate,startDate,endDate)));
        }  else if("10".equals(verfiyConfirmFlag)) {
            SwCkStatementConfirmBankQuickpassQrConsume swCkStatementConfirmBankQuickpassQrConsume = new SwCkStatementConfirmBankQuickpassQrConsume();
            //swCkStatementConfirmBankQuickpassQrConsume.setCreatorId(creatorId);
            return R.ok(swCkStatementConfirmBankQuickpassQrConsumeService.list(Wrappers.query(swCkStatementConfirmBankQuickpassQrConsume).lambda().between(SwCkStatementConfirmBankQuickpassQrConsume::getTradeDate,startDate,endDate)));
        }  else if("11".equals(verfiyConfirmFlag)) {
            SwCkStatementConfirmAlipayQrConsume swCkStatementConfirmAlipayQrConsume = new SwCkStatementConfirmAlipayQrConsume();
            //swCkStatementConfirmAlipayQrConsume.setCreatorId(creatorId);
            return R.ok(swCkStatementConfirmAlipayQrConsumeService.list(Wrappers.query(swCkStatementConfirmAlipayQrConsume).lambda().between(SwCkStatementConfirmAlipayQrConsume::getTradeDate,startDate,endDate)));
        }  else if("12".equals(verfiyConfirmFlag)) {
            SwCkStatementConfirmWechatQrConsume swCkStatementConfirmWechatQrConsume = new SwCkStatementConfirmWechatQrConsume();
            //swCkStatementConfirmWechatQrConsume.setCreatorId(creatorId);
            return R.ok(swCkStatementConfirmWechatQrConsumeService.list(Wrappers.query(swCkStatementConfirmWechatQrConsume).lambda().between(SwCkStatementConfirmWechatQrConsume::getTradeDate,startDate,endDate)));
        }  else if("13".equals(verfiyConfirmFlag)) {
            /*
			SwCkStatementConfirmAirQrConsume swCkStatementConfirmAirQrConsume = new SwCkStatementConfirmAirQrConsume();
            swCkStatementConfirmAirQrConsume.setCreatorId(creatorId);
            return R.ok(swCkStatementConfirmAirQrConsumeService.list(Wrappers.query(swCkStatementConfirmAirQrConsume).lambda().between(SwCkStatementConfirmAirQrConsume::getCreateTime,startDate,endDate)));
            */
			SwCkStatementCatXaztReplenish swCkStatementCatXaztReplenish = new SwCkStatementCatXaztReplenish();
            //swCkStatementCatXaztReplenish.setCreatorId(creatorId);
            return R.ok(swCkStatementCatXaztReplenishService.list(Wrappers.query(swCkStatementCatXaztReplenish).lambda().between(SwCkStatementCatXaztReplenish::getTradeDate,startDate,endDate)));
		} else if("14".equals(verfiyConfirmFlag)) {
            SwCkStatementCatReplenish swCkStatementCatReplenish = new SwCkStatementCatReplenish();
            //swCkStatementCatReplenish.setCreatorId(creatorId);
            return R.ok(swCkStatementCatReplenishService.list(Wrappers.query(swCkStatementCatReplenish).lambda().between(SwCkStatementCatReplenish::getTradeDate,startDate,endDate)));
        } else if("15".equals(verfiyConfirmFlag)) {
            SwCkStatementCatSubwayconsume swCkStatementCatSubwayconsume = new SwCkStatementCatSubwayconsume();
            //swCkStatementCatSubwayconsume.setCreatorId(creatorId);
            return R.ok(swCkStatementCatSubwayconsumeService.list(Wrappers.query(swCkStatementCatSubwayconsume).lambda().between(SwCkStatementCatSubwayconsume::getTradeDate,startDate,endDate)));
        }  else if("16".equals(verfiyConfirmFlag)) {
            SwCkStatementJtyktSubwayconsume swCkStatementJtyktSubwayconsume = new SwCkStatementJtyktSubwayconsume();
            //swCkStatementJtyktSubwayconsume.setCreatorId(creatorId);
            return R.ok(swCkStatementJtyktSubwayconsumeService.list(Wrappers.query(swCkStatementJtyktSubwayconsume).lambda().between(SwCkStatementJtyktSubwayconsume::getTradeDate,startDate,endDate)));
        }  else if("17".equals(verfiyConfirmFlag)) { //清分确认长安通卡
            SwCkClearingConfirmChanganCard swCkClearingConfirmChanganCard = new SwCkClearingConfirmChanganCard();
            //swCkClearingConfirmChanganCard.setCreatorId(creatorId);
            return R.ok(swCkClearingConfirmChanganCardService.list(Wrappers.query(swCkClearingConfirmChanganCard).lambda().between(SwCkClearingConfirmChanganCard::getTradeDate,startDate,endDate)));
        }  else if("18".equals(verfiyConfirmFlag)) { //清分确认交通卡
            SwCkClearingConfirmTrafficCard swCkClearingConfirmTrafficCard = new SwCkClearingConfirmTrafficCard();
            //swCkClearingConfirmTrafficCard.setCreatorId(creatorId);
            return R.ok(swCkClearingConfirmTrafficCardService.list(Wrappers.query(swCkClearingConfirmTrafficCard).lambda().between(SwCkClearingConfirmTrafficCard::getTradeDate,startDate,endDate)));
        } else if("19".equals(verfiyConfirmFlag)) {
            SwCkStatementConfirmAppQrConsume swCkStatementConfirmAppQrConsume = new SwCkStatementConfirmAppQrConsume();
            //swCkStatementConfirmAppQrConsume.setCreatorId(creatorId);
            return R.ok(swCkStatementConfirmAppQrConsumeService.list(Wrappers.query(swCkStatementConfirmAppQrConsume).lambda().between(SwCkStatementConfirmAppQrConsume::getTradeDate,startDate,endDate)));
        } else if("20".equals(verfiyConfirmFlag)) {
            SwCkStatementConfirmDailyticketCatConsume swCkStatementConfirmDailyticketCatConsume = new SwCkStatementConfirmDailyticketCatConsume();
            //swCkStatementConfirmDailyticketCatConsume.setCreatorId(creatorId);
            return R.ok(swCkStatementConfirmDailyticketCatConsumeService.list(Wrappers.query(swCkStatementConfirmDailyticketCatConsume).lambda().between(SwCkStatementConfirmDailyticketCatConsume::getTradeDate,startDate,endDate)));
        }else if("21".equals(verfiyConfirmFlag)) {//西安地铁支付宝应急及互联互通对账确认表		  
			SwCkStatementConfirmAlipayQrConnectivity swCkStatementConfirmAlipayQrConnectivity = new SwCkStatementConfirmAlipayQrConnectivity();
            //swCkStatementConfirmAlipayQrConnectivity.setCreatorId(creatorId);
            return R.ok(swCkStatementConfirmAlipayQrConnectivityService.list(Wrappers.query(swCkStatementConfirmAlipayQrConnectivity).lambda().between(SwCkStatementConfirmAlipayQrConnectivity::getTradeDate,startDate,endDate)));
            
        } else if("22".equals(verfiyConfirmFlag)) {//西安地铁微信应急及互联互通对账确认表
            SwCkStatementConfirmWechatQrConnectivity swCkStatementConfirmWechatQrConnectivity = new SwCkStatementConfirmWechatQrConnectivity();
            //swCkStatementConfirmWechatQrConnectivity.setCreatorId(creatorId);
            return R.ok(swCkStatementConfirmWechatQrConnectivityService.list(Wrappers.query(swCkStatementConfirmWechatQrConnectivity).lambda().between(SwCkStatementConfirmWechatQrConnectivity::getTradeDate,startDate,endDate)));
        } else if("23".equals(verfiyConfirmFlag)) {
            SwCkStatementConfirmAppWechat swCkStatementConfirmAppWechat = new SwCkStatementConfirmAppWechat();
            //swCkStatementConfirmAppQrConsume.setCreatorId(creatorId);
            return R.ok(swCkStatementConfirmAppWechatService.list(Wrappers.query(swCkStatementConfirmAppWechat).lambda().between(SwCkStatementConfirmAppWechat::getTradeDate,startDate,endDate)));
        } else if("24".equals(verfiyConfirmFlag)) {
            SwCkStatementConfirmBomPos swCkStatementConfirmBomPos = new SwCkStatementConfirmBomPos();
            return R.ok(swCkStatementConfirmBomPosService.list(Wrappers.query(swCkStatementConfirmBomPos).lambda().between(SwCkStatementConfirmBomPos::getTradeDate,startDate,endDate)));
        } else {
            return R.ok();
        }

    }

    /**
     * 差异数据查看
     * @return
     */
    @ApiOperation(value = "差异数据查看", notes = "差异数据查看")
    @GetMapping("/previewDiff" )
    public R previewDiff(String tradeDateStr,String verfiyConfirmFlag) throws Exception {
        if(StringUtils.isEmpty(tradeDateStr) || StringUtils.isEmpty(verfiyConfirmFlag)){
            return R.ok(CommonConstants.FAIL);
        }
        LocalDate tradeDate = LocalDate.parse(tradeDateStr, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
        if("1".equals(verfiyConfirmFlag)) {
            SwCkStatementConfirmFacetoBank swCkStatementConfirmFacetoBank = new SwCkStatementConfirmFacetoBank();
            swCkStatementConfirmFacetoBank.setTradeDate(tradeDate);
            return R.ok(swCkStatementConfirmFacetoBankService.list(Wrappers.query(swCkStatementConfirmFacetoBank)));
        } else if("2".equals(verfiyConfirmFlag)) {
            SwCkStatementConfirmFacetoWechat swCkStatementConfirmFacetoWechat = new SwCkStatementConfirmFacetoWechat();
            swCkStatementConfirmFacetoWechat.setTradeDate(tradeDate);
            return R.ok(swCkStatementConfirmFacetoWechatService.list(Wrappers.query(swCkStatementConfirmFacetoWechat)));
        } else if("3".equals(verfiyConfirmFlag)) {
            SwCkStatementConfirmFacetoAlipay swCkStatementConfirmFacetoAlipay = new SwCkStatementConfirmFacetoAlipay();
            swCkStatementConfirmFacetoAlipay.setTradeDate(tradeDate);
            return R.ok(swCkStatementConfirmFacetoAlipayService.list(Wrappers.query(swCkStatementConfirmFacetoAlipay)));
        } else if("4".equals(verfiyConfirmFlag)) {
            SwCkStatementConfirmBomQrAlipay swCkStatementConfirmBomQrAlipay = new SwCkStatementConfirmBomQrAlipay();
            swCkStatementConfirmBomQrAlipay.setTradeDate(tradeDate);
            return R.ok(swCkStatementConfirmBomQrAlipayService.list(Wrappers.query(swCkStatementConfirmBomQrAlipay)));
        } else if("5".equals(verfiyConfirmFlag)) {
            SwCkStatementConfirmBomQrWechat swCkStatementConfirmBomQrWechat = new SwCkStatementConfirmBomQrWechat();
            swCkStatementConfirmBomQrWechat.setTradeDate(tradeDate);
            return R.ok(swCkStatementConfirmBomQrWechatService.list(Wrappers.query(swCkStatementConfirmBomQrWechat)));
        } else if("6".equals(verfiyConfirmFlag)) {
            SwCkStatementConfirmTvmAlipay swCkStatementConfirmTvmAlipay = new SwCkStatementConfirmTvmAlipay();
            swCkStatementConfirmTvmAlipay.setTradeDate(tradeDate);
            return R.ok(swCkStatementConfirmTvmAlipayService.list(Wrappers.query(swCkStatementConfirmTvmAlipay)));
        } else if("7".equals(verfiyConfirmFlag)) {
            SwCkStatementConfirmTvmWechat swCkStatementConfirmTvmWechat = new SwCkStatementConfirmTvmWechat();
            swCkStatementConfirmTvmWechat.setTradeDate(tradeDate);
            return R.ok(swCkStatementConfirmTvmWechatService.list(Wrappers.query(swCkStatementConfirmTvmWechat)));
        } else if("8".equals(verfiyConfirmFlag)) {
            SwCkStatementConfirmTvmBank swCkStatementConfirmTvmBank = new SwCkStatementConfirmTvmBank();
            swCkStatementConfirmTvmBank.setTradeDate(tradeDate);
            return R.ok(swCkStatementConfirmTvmBankService.list(Wrappers.query(swCkStatementConfirmTvmBank)));
        } else if("9".equals(verfiyConfirmFlag)) {
            SwCkStatementConfirmBankQrConsume swCkStatementConfirmBankQrConsume = new SwCkStatementConfirmBankQrConsume();
            swCkStatementConfirmBankQrConsume.setTradeDate(tradeDate);
            return R.ok(swCkStatementConfirmBankQrConsumeService.list(Wrappers.query(swCkStatementConfirmBankQrConsume)));
        }  else if("10".equals(verfiyConfirmFlag)) {
            SwCkStatementConfirmBankQuickpassQrConsume swCkStatementConfirmBankQuickpassQrConsume = new SwCkStatementConfirmBankQuickpassQrConsume();
            swCkStatementConfirmBankQuickpassQrConsume.setTradeDate(tradeDate);
            return R.ok(swCkStatementConfirmBankQuickpassQrConsumeService.list(Wrappers.query(swCkStatementConfirmBankQuickpassQrConsume)));
        }  else if("11".equals(verfiyConfirmFlag)) {
            SwCkStatementConfirmAlipayQrConsume swCkStatementConfirmAlipayQrConsume = new SwCkStatementConfirmAlipayQrConsume();
            swCkStatementConfirmAlipayQrConsume.setTradeDate(tradeDate);
            return R.ok(swCkStatementConfirmAlipayQrConsumeService.list(Wrappers.query(swCkStatementConfirmAlipayQrConsume)));
        }  else if("12".equals(verfiyConfirmFlag)) {
            SwCkStatementConfirmWechatQrConsume swCkStatementConfirmWechatQrConsume = new SwCkStatementConfirmWechatQrConsume();
            swCkStatementConfirmWechatQrConsume.setTradeDate(tradeDate);
            return R.ok(swCkStatementConfirmWechatQrConsumeService.list(Wrappers.query(swCkStatementConfirmWechatQrConsume)));
        }  else if("13".equals(verfiyConfirmFlag)) {
            /*
			SwCkStatementConfirmAirQrConsume swCkStatementConfirmAirQrConsume = new SwCkStatementConfirmAirQrConsume();
            swCkStatementConfirmAirQrConsume.setTradeDate(tradeDate);
            return R.ok(swCkStatementConfirmAirQrConsumeService.list(Wrappers.query(swCkStatementConfirmAirQrConsume)));
            */
            SwCkStatementCatXaztReplenish swCkStatementCatXaztReplenish = new SwCkStatementCatXaztReplenish();
            swCkStatementCatXaztReplenish.setTradeDate(tradeDate);
            return R.ok(swCkStatementCatXaztReplenishService.list(Wrappers.query(swCkStatementCatXaztReplenish)));
        } else if("14".equals(verfiyConfirmFlag)) {
            SwCkStatementCatReplenish swCkStatementCatReplenish = new SwCkStatementCatReplenish();
            swCkStatementCatReplenish.setTradeDate(tradeDate);
            return R.ok(swCkStatementCatReplenishService.list(Wrappers.query(swCkStatementCatReplenish)));
        } else if("15".equals(verfiyConfirmFlag)) {
            SwCkStatementCatSubwayconsume swCkStatementCatSubwayconsume = new SwCkStatementCatSubwayconsume();
            swCkStatementCatSubwayconsume.setTradeDate(tradeDate);
            return R.ok(swCkStatementCatSubwayconsumeService.list(Wrappers.query(swCkStatementCatSubwayconsume)));
        }  else if("16".equals(verfiyConfirmFlag)) {
            SwCkStatementJtyktSubwayconsume swCkStatementJtyktSubwayconsume = new SwCkStatementJtyktSubwayconsume();
            swCkStatementJtyktSubwayconsume.setTradeDate(tradeDate);
            return R.ok(swCkStatementJtyktSubwayconsumeService.list(Wrappers.query(swCkStatementJtyktSubwayconsume)));
        }  else if("17".equals(verfiyConfirmFlag)) { //清分确认长安通卡
            SwCkClearingConfirmChanganCard swCkClearingConfirmChanganCard = new SwCkClearingConfirmChanganCard();
            swCkClearingConfirmChanganCard.setTradeDate(tradeDate);
            return R.ok(swCkClearingConfirmChanganCardService.list(Wrappers.query(swCkClearingConfirmChanganCard)));
        }  else if("18".equals(verfiyConfirmFlag)) { //清分确认交通卡
            SwCkClearingConfirmTrafficCard swCkClearingConfirmTrafficCard = new SwCkClearingConfirmTrafficCard();
            swCkClearingConfirmTrafficCard.setTradeDate(tradeDate);
            return R.ok(swCkClearingConfirmTrafficCardService.list(Wrappers.query(swCkClearingConfirmTrafficCard)));
        } else if("19".equals(verfiyConfirmFlag)) {
            SwCkStatementConfirmAppQrConsume swCkStatementConfirmAppQrConsume = new SwCkStatementConfirmAppQrConsume();
            swCkStatementConfirmAppQrConsume.setTradeDate(tradeDate);
            return R.ok(swCkStatementConfirmAppQrConsumeService.list(Wrappers.query(swCkStatementConfirmAppQrConsume)));
        } else if("20".equals(verfiyConfirmFlag)) {
            SwCkStatementConfirmDailyticketCatConsume swCkStatementConfirmDailyticketCatConsume = new SwCkStatementConfirmDailyticketCatConsume();
            swCkStatementConfirmDailyticketCatConsume.setTradeDate(tradeDate);
            return R.ok(swCkStatementConfirmDailyticketCatConsumeService.list(Wrappers.query(swCkStatementConfirmDailyticketCatConsume)));
        }else if("21".equals(verfiyConfirmFlag)) {//西安地铁支付宝应急及互联互通对账确认表		  
			SwCkStatementConfirmAlipayQrConnectivity swCkStatementConfirmAlipayQrConnectivity = new SwCkStatementConfirmAlipayQrConnectivity();
            swCkStatementConfirmAlipayQrConnectivity.setTradeDate(tradeDate);
			return R.ok(swCkStatementConfirmAlipayQrConnectivityService.list(Wrappers.query(swCkStatementConfirmAlipayQrConnectivity)));           
            
        } else if("22".equals(verfiyConfirmFlag)) {//西安地铁微信应急及互联互通对账确认表
            SwCkStatementConfirmWechatQrConnectivity swCkStatementConfirmWechatQrConnectivity = new SwCkStatementConfirmWechatQrConnectivity();
            swCkStatementConfirmWechatQrConnectivity.setTradeDate(tradeDate);
            return R.ok(swCkStatementConfirmWechatQrConnectivityService.list(Wrappers.query(swCkStatementConfirmWechatQrConnectivity)));    
			
        }else if("23".equals(verfiyConfirmFlag)) {
            SwCkStatementConfirmAppWechat swCkStatementConfirmAppWechat = new SwCkStatementConfirmAppWechat();
            swCkStatementConfirmAppWechat.setTradeDate(tradeDate);
            return R.ok(swCkStatementConfirmAppWechatService.list(Wrappers.query(swCkStatementConfirmAppWechat)));
        }else if("24".equals(verfiyConfirmFlag)) {
            SwCkStatementConfirmBomPos swCkStatementConfirmBomPos = new SwCkStatementConfirmBomPos();
            swCkStatementConfirmBomPos.setTradeDate(tradeDate);
            return R.ok(swCkStatementConfirmBomPosService.list(Wrappers.query(swCkStatementConfirmBomPos)));
        } else {
            return R.ok();
        }

    }

}
